<?php
class Block_IncludeBlock extends Zend_View_Helper_Abstract{
	public function includeblock($position){	
		
		
		$view = $this->view;
		$db = Zend_Registry::get('connectDB');
		$sql = "select * 
				from block 
				where position='$position' 
					  AND enable='1' 
					  AND (id in (select blockid 
					  			  from menu_block 
					  			  where menuid=".Zend_Registry::get('menu')."))  
				ORDER BY ordering ASC";
		$result = $db->fetchAll($sql);
		
		foreach ($result as $value) {
			require(BLOCK_PATH .'/'.$value['type']. "/default.php");
		}	
	}
}